<?php
declare(strict_types=1);

namespace lib\data\virtual;

/**
 * 虚拟数据类, 用于同步数据 数据库=>客户端
 */
class GoodsOrder extends \lib\sync\SyncableData {
    protected static string $SyncKey = 'GoodsOrder';
    protected static string $TableName = 'tp_nb_goods_order';


    # 待支付 已支付 待出货 已出货 已完成 已撤销
    const STAGE_WAIT_PAY = 1;       # 待支付
    const STAGE_PAID = 2;           # 已支付
    const STAGE_WAIT_SHIP = 3;      # 待出货
    const STAGE_SHIPPED = 4;        # 已出货
    const STAGE_FINISHED = 5;       # 已完成
    const STAGE_CANCELLED = 6;      # 已撤销
    

    const SETTLE_MODE_CREDIT   = 0;        # 挂账
    const SETTLE_MODE_NOPAY    = 1;        # 未支付
    const SETTLE_MODE_GIFT     = 2;        # 赠送
    const SETTLE_MODE_CASH     = 3;        # 现金
    const SETTLE_MODE_ONLINE   = 4;        # 线上
    const SETTLE_MODE_MEMBER   = 5;        # 会员卡余额(网吧计费卡)
    public static array $SETTLE_SRC = [0=>'amount', 1=>'amount_online', 2=>'amount_member'];

    const PAY_MODE_CASH        = 0;        # 现金
    const PAY_MODE_PAYCODE     = 1;       # 支付码
    const PAY_MODE_QRCODE      = 2;       # 二维码

    const PAY_SRC_CASH         = 0;        # 现金(记账类型)
    const PAY_SRC_ONLINE       = 1;        # 线上(记账类型)
    const PAY_SRC_MEMBER       = 2;        # 会员卡(记账类型)

    const ORDER_TYPE           = 12;       # 商品购买订单类型

    const SCENE_BAR            = 1;        # 吧台
    const SCENE_STA            = 2;        # 工作站
    const SCENE_APP            = 3;        # APP
    
}